import del from "rollup-plugin-delete";
import postcss from "rollup-plugin-postcss";
import copy from "rollup-plugin-copy";

export default {
  input: "packages/theme-chalk/src/index.scss",
  output: {
    file: "dist/theme-chalk/index.css",
    format: "es",
  },
  plugins: [
    del({ targets: "dist/theme-chalk" }),
    postcss({
      extract: true, // 单独生成一个 css 文件
      minimize: true, // 压缩
    }),
    copy({
      targets: [
        {
          src: "packages/theme-chalk/package.json",
          dest: "dist/theme-chalk",
        },
        {
          src: "packages/theme-chalk/src/fonts/**/*",
          dest: "dist/theme-chalk/fonts",
        },
      ],
    }),
  ],
} as import("rollup").RollupOptions;
